function query_goodsApply(page) {
	sys_loading();
	var parm = $('#queryGoodsApplyForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('goodsApply-query');
	sys_record_parm('goodsApply',parm);
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function save_goodsApply() {
	  
	var url =  create_url('goodsApply-affirm');
	var parm = $('#editForm').serialize();
	$.ajax({type:'POST', url:url, data:parm,success : function(result) {
			if ('success' == result) {
				var parm = $('#editForm').serialize();
				var url = create_url('goodsApply-save');
				sys_submiting();
				$.ajax({type:'POST', url:url, data:parm,success: function(result) {
						sys_submiting_close();
						if (result == 'success') {
							sys_msg('操作成功!');
							sys_load_handle('goodsApply');
						}else if (result == 'error') {
							sys_msg('操作失败！');
						} 
					}
				});
			}else if ('error' == result){
				sys_msg('密码错误！');
			}else if ('parameter_error' == result){
				sys_msg('请输入确认密码！');
			}
		}
	});
}


function shield_goodsApply(code, name) {
	$.Zebra_Dialog('确定是否屏蔽'+name + ' 物品吗？',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'屏蔽',callback:function() {
    	   var url = create_url('goodsApply-shield');
    	   aidExecute_goodsApply(code, url);
		}},
       {caption:'取消',callback:function(){}
       }]
	});
}

function unshield_goodsApply(code, name) {
	$.Zebra_Dialog('确定要给'+name + ' 物品解除屏蔽吗？',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'解除',callback:function() {
    	   var url = create_url('goodsApply-unshield');
    	   aidExecute_goodsApply(code, url);
		}},
       {caption:'取消',callback:function(){}
       }]
	});
}

function aidExecute_goodsApply(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功!');
				query_goodsApply();
			} else {
				sys_warning('操作失败', '操作失败，请刷新页面再次尝试，如果问题依然存在，请联系管理员!');
			}
		}
	});
}